package com.haoshuang.zhouzhoubang.ui.adapter

import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemViolationDeductMoneyOrderListChildBinding
import com.haoshuang.zhouzhoubang.model.bean.BalanceDetailGroupListBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.textColor

/**
 * 
 */
class ViolationDeductMoneyOrderListChildAdapter(data: MutableList<BalanceDetailGroupListBean.BalanceDetailGroupBean.BalanceDetailBean>) : BaseBindingQuickAdapter<BalanceDetailGroupListBean.BalanceDetailGroupBean.BalanceDetailBean, ItemViolationDeductMoneyOrderListChildBinding>(data) {

    override fun onBindViewHolder(
        holder: BaseBindingHolder,
        position: Int,
        item: BalanceDetailGroupListBean.BalanceDetailGroupBean.BalanceDetailBean?
    ) {
        holder.getViewBinding<ItemViolationDeductMoneyOrderListChildBinding>().apply {
            tvTitle.text = item?.mark
            tvTime.text = item?.add_time
            if (item?.pm == 1) {
                tvValue.textColor = R.color.c_00c24e
                tvValue.text = "${item.number}"
            } else {
                tvValue.textColor = R.color.c_ff0000
                tvValue.text = item?.number
            }
        }
    }
}
